package com.anjubao.parking.municipal.payment.feign;

import com.anjubao.parking.municipal.common.dto.ApiResult;
import com.anjubao.parking.municipal.payment.dto.*;
import com.anjubao.parking.municipal.payment.form.BalanceRechargeForm;
import com.anjubao.parking.municipal.payment.form.PayOrderForm;
import com.anjubao.parking.municipal.payment.form.SubmitOrderForm;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 支付中心对外支付api
 * 提供者: 支付中心 municipalparking-order-service
 *
 * @author zhuchunfeng
 * @date 2019/5/14 9:10
 */
public interface ParkingTradeOrderRest {

    /**
     * 系统会生成一笔停车订单并获取支付参数
     *
     * @param systemType 子系统 1-开放式停车 2-封闭停车
     * @param submitOrderForm 停车订单信息
     * @return 支付参数
     */
    @ApiOperation("提交订单")
    @PostMapping("/parking-trade-orders/{systemType}/order-submit")
    ApiResult<OrderResponseDto> submitOrder(@ApiParam(value = "1-开放式停车 2-封闭停车",name = "systemType") @PathVariable Integer systemType,
                                            @RequestBody SubmitOrderForm submitOrderForm);


    /**
     * 对于已存在的未支付订单,直接获取订单的支付参数
     *
     * @param systemType 子系统 1-开放式停车 2-封闭停车
     * @param payOrderForm 未支付的订单
     * @return 支付参数
     */
    @ApiOperation("快捷支付")
    @PostMapping("/parking-trade-orders/{systemType}/order-pay")
    ApiResult<OrderResponseDto> quickPay(@ApiParam(value = "1-开放式停车 2-封闭停车",name = "systemType") @PathVariable Integer systemType,
                                         @RequestBody PayOrderForm payOrderForm);


    /**
     * 直接获取支付参数
     *
     * @param balanceRechargeForm 余额充值参数
     * @return 支付参数
     */
    @ApiOperation("余额充值")
    @PostMapping("/parking-trade-orders/balance-recharge")
    ApiResult<PayResponseDto> balanceRecharge(@RequestBody BalanceRechargeForm balanceRechargeForm);


}
